<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
<html xmlns="https://www.w3.org/1999/xhtml" lang="zh-CN" xml:lang="zh-CN">
<head><meta http-equiv="Content-Type" content="application/xhtml+xml; charset=utf-8" />
    <title>5.14. Bash-3.1</title>
    <link rel="stylesheet" href="../stylesheets/lfs.css" type="text/css" />
    <link rel="stylesheet" href="../stylesheets/lfs-print.css" type="text/css" media="print" />
<script> var _hmt = _hmt || []; (function() { var hm = document.createElement("script"); hm.src = "https://hm.baidu.com/hm.js?d286c55b63a3c54a1e43d10d4c203e75"; var s = document.getElementsByTagName("script")[0]; s.parentNode.insertBefore(hm, s); })(); </script>
</head>
  <body id="lfs" class="6.2">
    <div class="navheader">
      <div class="headertitles">
        <h4>Linux From Scratch - 版本 6.2</h4>
        <h3>第五章 构建临时编译环境</h3>
      </div>
      <ul class="headerlinks">
        <li class="prev">
          <a accesskey="p" href="ncurses.html" title="Ncurses-5.5">后退</a>
          <p>Ncurses-5.5</p>
        </li>
        <li class="next">
          <a accesskey="n" href="bzip2.html" title="Bzip2-1.0.3">前进</a>
          <p>Bzip2-1.0.3</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter05.html" title="第五章 构建临时编译环境">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a></li>
      </ul>
    </div>
    <div class="wrap">
      <div class="titlepage">
        <h1 class="sect1">5.14. Bash-3.1</h1>
      </div>
      <div class="package">
        <p>Bash 是 Bourne-Again Shell 的缩写，它在 UNIX 系统中作为 shell 被广泛使用。</p>
        <div class="segmentedlist">
          <div class="seglistitem">
            <div class="seg">
              <strong><span class="segtitle">预计编译时间：</span></strong> <span class="seg">0.4 SBU</span>
            </div>
            <div class="seg">
              <strong><span class="segtitle">所需磁盘空间：</span></strong> <span class="seg">22 MB</span>
            </div>
          </div>
        </div>
      </div>
      <div class="installation">
        <div class="titlepage">
          <h2 class="sect2">5.14.1. 安装 Bash</h2>
        </div>
        <p>Bash-3.1 正式发布以后开发者们又修正了许多缺陷，下面的补丁包含了这些修正：</p>
        <pre class="userinput"><kbd class="command">patch -Np1 -i ../bash-3.1-fixes-8.patch</kbd></pre>
        <p>为编译 Bash 做准备：</p>
        <pre class="userinput"><kbd class="command">./configure --prefix=/tools --without-bash-malloc</kbd></pre>
        <div class="variablelist">
          <p class="title">
            <b>配置选项的含义：</b></p>
          <dl>
            <dt>
              <span class="term"><em class="parameter"><tt>--without-bash-malloc</tt></em></span>
            </dt>
            <dd>
              <p>这个选项禁用了 Bash 的内存分配函数(<tt class="function">malloc</tt>)，这个函数已知会造成段错误，通过设置这个选项，Bash 将使用更为稳定的 Glibc 里的 <tt class="function">malloc</tt> 函数。</p>
            </dd>
          </dl>
        </div>
        <p>编译软件包：</p>
        <pre class="userinput"><kbd class="command">make</kbd></pre>
        <p>要测试结果，请运行：<strong class="userinput"><tt>make tests</tt></strong> 。</p>
        <p>安装软件包：</p>
        <pre class="userinput"><kbd class="command">make install</kbd></pre>
        <p>为那些用 <span><strong class="command">sh</strong></span> 作为 shell 的程序创建符号链接：</p>
        <pre class="userinput"><kbd class="command">ln -vs bash /tools/bin/sh</kbd></pre>
      </div>
      <div class="content">
        <p>关于这个软件包的详细资料位于<a href="../chapter06/bash.html#contents-bash" title="6.27.2. Bash 的内容">节 6.27.2, Bash 的内容</a></p>
      </div>
    </div>
    <div class="navfooter">
      <ul>
        <li class="prev">
          <a accesskey="p" href="ncurses.html" title="Ncurses-5.5">后退</a>
          <p>Ncurses-5.5</p>
        </li>
        <li class="next">
          <a accesskey="n" href="bzip2.html" title="Bzip2-1.0.3">前进</a>
          <p>Bzip2-1.0.3</p>
        </li>
        <li class="up"><a accesskey="u" href="chapter05.html" title="第五章 构建临时编译环境">上一级</a></li>
        <li class="home"><a accesskey="h" href="../index.html" title="Linux From Scratch - 版本 6.2">首页</a>.
        </li>
      </ul>
    </div>
</body></html>
